<%@ page import="com.hncg.dao.UserDao" %>
<%@ page import="com.hncg.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: chongge
  Date: 2024/1/10
  Time: 9:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
       String name =   request.getParameter("name");
       String pwd = request.getParameter("pwd");
       int age =Integer.parseInt(request.getParameter("age"));
//       String hiredate = request.getParameter("hiredate");
        UserDao userDao = new UserDao();
        User user = new User(name, pwd, age);
        boolean result = userDao.userReg(user);
        if (result){
            out.print("<script>alert('注册成功,请登录!')</script>");
            response.sendRedirect("login.jsp");
        }else{
            response.sendRedirect("register.jsp");
        }
    %>

</body>
</html>
